/*
 * (C) Copyright 2016 Ymatou (http://www.ymatou.com/).
 * 
 * All rights reserved.
 */
package com.ymatou.iapi.trading.operate.parameter.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 取消订单枚举，与.NET版本保持完全一致
 * 
 * @author tuwenjie 2016年5月7日 下午5:12:59
 *
 */
public enum CancelOrderTypeEnum {

    // 买家取消
    BUYER_CANCEL_ORDER(1),
    // 卖家取消
    SELLER_CANCEL_ORDER(2),
    // 客服取消
    CUSTOMER_CANCEL_ORDER(3),
    // 系统取消
    SYSTEM_CANCEL_ORDER(4),
    // 风控取消
    RISKCONTROL_CANCEL_ORDER(5);

    int code;

    private static final Map<Integer, CancelOrderTypeEnum> maps = new HashMap<>();

    static {
        for (CancelOrderTypeEnum cancelOrderTypeEnum : CancelOrderTypeEnum.values()) {
            maps.put(cancelOrderTypeEnum.getCode(), cancelOrderTypeEnum);
        }
    }

    CancelOrderTypeEnum(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }


    @Override
    public String toString() {
        return String.valueOf(code);
    }
}
